
ticketHub.controller('priceCalendarCtrl',function($scope,$http,$state){
	//被选中的月份
	$scope.isActive = true;
	//无搜索结果时不显示
	$scope.show = false;
	//查询条件
	$scope.queryData = {
			departure:"",
			arrivals:""			
	};
	//查询
	$scope.query = function(){
		if($scope.queryData.departure==""||$scope.queryData.arrivals==""){
			layer.msg("请填写所有搜索条件",{icon:2});
			return false;
		}
		var postData = {
			departure:($scope.queryData.departure).toUpperCase(),
			arrivals:($scope.queryData.arrivals).toUpperCase(),
			start:start()
		}		
		query(postData);
	}
	//查询方法
	function query(postData){
		//在本地存储中添加查询条件
		sessionStorage.jiageriliData = JSON.stringify(postData); 
		//价格日历
		$(".rili").load("../html/ca/priceCalendar.html");	
		$scope.show = true;
	}
	//获取当前年月日
	function start(){
		var date = new Date();
		var year = date.getFullYear();
		var month = date.getMonth()+1;
		month = (month<10 ? "0"+month:month); 
		day = date.getDate();
		return year+"-"+month+"-"+day;
	}
	
	
	
})
	
	
